package com.zz.parkingsystem.entity;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 泊位表
 * @TableName t_parking
 */
@Data
public class Parking implements Serializable {
    /**
     * 泊位id
     */
    private Integer pkId;

    /**
     * 泊位编号
     */
    private Integer pkNo;

    /**
     * 路段id
     */
    private Integer secId;

    /**
     * 地磁ID
     */
    private Integer geoId;

    /**
     * 车位状态：-1：未激活  1：有车 0：无车
     */
    private Integer pkStatus;

    /**
     * 泊位创建时间
     */
    private Date pkCreatedTime;

    /**
     * 激活时间
     */
    private Date pkActiveTime;

    /**
     * 预留varchar字段
     */
    private String reservedVar;
    private String geoModel;

    /**
     * 预留int字段
     */
    private Integer reservedInt;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Parking other = (Parking) that;
        return (this.getPkId() == null ? other.getPkId() == null : this.getPkId().equals(other.getPkId()))
            && (this.getPkNo() == null ? other.getPkNo() == null : this.getPkNo().equals(other.getPkNo()))
            && (this.getSecId() == null ? other.getSecId() == null : this.getSecId().equals(other.getSecId()))
            && (this.getGeoId() == null ? other.getGeoId() == null : this.getGeoId().equals(other.getGeoId()))
            && (this.getPkStatus() == null ? other.getPkStatus() == null : this.getPkStatus().equals(other.getPkStatus()))
            && (this.getPkCreatedTime() == null ? other.getPkCreatedTime() == null : this.getPkCreatedTime().equals(other.getPkCreatedTime()))
            && (this.getPkActiveTime() == null ? other.getPkActiveTime() == null : this.getPkActiveTime().equals(other.getPkActiveTime()))
            && (this.getReservedVar() == null ? other.getReservedVar() == null : this.getReservedVar().equals(other.getReservedVar()))
            && (this.getReservedInt() == null ? other.getReservedInt() == null : this.getReservedInt().equals(other.getReservedInt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPkId() == null) ? 0 : getPkId().hashCode());
        result = prime * result + ((getPkNo() == null) ? 0 : getPkNo().hashCode());
        result = prime * result + ((getSecId() == null) ? 0 : getSecId().hashCode());
        result = prime * result + ((getGeoId() == null) ? 0 : getGeoId().hashCode());
        result = prime * result + ((getPkStatus() == null) ? 0 : getPkStatus().hashCode());
        result = prime * result + ((getPkCreatedTime() == null) ? 0 : getPkCreatedTime().hashCode());
        result = prime * result + ((getPkActiveTime() == null) ? 0 : getPkActiveTime().hashCode());
        result = prime * result + ((getReservedVar() == null) ? 0 : getReservedVar().hashCode());
        result = prime * result + ((getReservedInt() == null) ? 0 : getReservedInt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", pkId=").append(pkId);
        sb.append(", pkNo=").append(pkNo);
        sb.append(", secId=").append(secId);
        sb.append(", geoId=").append(geoId);
        sb.append(", pkStatus=").append(pkStatus);
        sb.append(", pkCreatedTime=").append(pkCreatedTime);
        sb.append(", pkActiveTime=").append(pkActiveTime);
        sb.append(", reservedVar=").append(reservedVar);
        sb.append(", reservedInt=").append(reservedInt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}